Optimal. Leaf size=88 \[ \frac {1}{8} (3 A+4 C) x+\frac {B \sin (c+d x)}{d}+\frac {(3 A+4 C) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {A \cos ^3(c+d x) \sin (c+d x)}{4 d}-\frac {B \sin ^3(c+d x)}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 88, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 5, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.172, Rules used = {4132, 2713,
4130, 2715, 8} \begin {gather*} \frac {(3 A+4 C) \sin (c+d x) \cos (c+d x)}{8 d}+\frac {A \sin (c+d x) \cos ^3(c+d x)}{4 d}+\frac {1}{8} x (3 A+4 C)-\frac {B \sin ^3(c+d x)}{3 d}+\frac {B \sin (c+d x)}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2713
Rule 2715
Rule 4130
Rule 4132
Rubi steps
\begin {align*} \int \cos ^4(c+d x) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=B \int \cos ^3(c+d x) \, dx+\int \cos ^4(c+d x) \left (A+C \sec ^2(c+d x)\right ) \, dx\\ &=\frac {A \cos ^3(c+d x) \sin (c+d x)}{4 d}+\frac {1}{4} (3 A+4 C) \int \cos ^2(c+d x) \, dx-\frac {B \text {Subst}\left (\int \left (1-x^2\right ) \, dx,x,-\sin (c+d x)\right )}{d}\\ &=\frac {B \sin (c+d x)}{d}+\frac {(3 A+4 C) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {A \cos ^3(c+d x) \sin (c+d x)}{4 d}-\frac {B \sin ^3(c+d x)}{3 d}+\frac {1}{8} (3 A+4 C) \int 1 \, dx\\ &=\frac {1}{8} (3 A+4 C) x+\frac {B \sin (c+d x)}{d}+\frac {(3 A+4 C) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {A \cos ^3(c+d x) \sin (c+d x)}{4 d}-\frac {B \sin ^3(c+d x)}{3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.12, size = 70, normalized size = 0.80 \begin {gather*} \frac {36 A c+48 c C+36 A d x+48 C d x+96 B \sin (c+d x)-32 B \sin ^3(c+d x)+24 (A+C) \sin (2 (c+d x))+3 A \sin (4 (c+d x))}{96 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.69, size = 84, normalized size = 0.95
method | result | size |
risch | \(\frac {3 A x}{8}+\frac {C x}{2}+\frac {3 B \sin \left (d x +c \right )}{4 d}+\frac {A \sin \left (4 d x +4 c \right )}{32 d}+\frac {B \sin \left (3 d x +3 c \right )}{12 d}+\frac {A \sin \left (2 d x +2 c \right )}{4 d}+\frac {C \sin \left (2 d x +2 c \right )}{4 d}\) | \(82\) |
derivativedivides | \(\frac {A \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+\frac {B \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+C \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}\) | \(84\) |
default | \(\frac {A \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+\frac {B \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+C \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}\) | \(84\) |
norman | \(\frac {\left (-\frac {3 A}{8}-\frac {C}{2}\right ) x +\left (-\frac {9 A}{8}-\frac {3 C}{2}\right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-\frac {3 A}{4}-C \right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {3 A}{4}+C \right ) x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {3 A}{8}+\frac {C}{2}\right ) x \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {9 A}{8}+\frac {3 C}{2}\right ) x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {2 \left (3 A -2 B \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}+\frac {2 \left (3 A +2 B \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}-\frac {\left (3 A -4 C \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}-\frac {\left (5 A -8 B +4 C \right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}-\frac {\left (5 A +8 B +4 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}\) | \(259\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 77, normalized size = 0.88 \begin {gather*} \frac {3 \, {\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} A - 32 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} B + 24 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} C}{96 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.89, size = 65, normalized size = 0.74 \begin {gather*} \frac {3 \, {\left (3 \, A + 4 \, C\right )} d x + {\left (6 \, A \cos \left (d x + c\right )^{3} + 8 \, B \cos \left (d x + c\right )^{2} + 3 \, {\left (3 \, A + 4 \, C\right )} \cos \left (d x + c\right ) + 16 \, B\right )} \sin \left (d x + c\right )}{24 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (A + B \sec {\left (c + d x \right )} + C \sec ^{2}{\left (c + d x \right )}\right ) \cos ^{4}{\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 200 vs.
\(2 (80) = 160\).
time = 0.43, size = 200, normalized size = 2.27 \begin {gather*} \frac {3 \, {\left (d x + c\right )} {\left (3 \, A + 4 \, C\right )} - \frac {2 \, {\left (15 \, A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 24 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 12 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 9 \, A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 40 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 12 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 9 \, A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 40 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 12 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 15 \, A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 24 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 12 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{4}}}{24 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.53, size = 81, normalized size = 0.92 \begin {gather*} \frac {3\,A\,x}{8}+\frac {C\,x}{2}+\frac {A\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}+\frac {A\,\sin \left (4\,c+4\,d\,x\right )}{32\,d}+\frac {B\,\sin \left (3\,c+3\,d\,x\right )}{12\,d}+\frac {C\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}+\frac {3\,B\,\sin \left (c+d\,x\right )}{4\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________